/*
 * Symbol.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */
package engine;

import java.util.*;
import java.io.*;
import middle.*;


/**
 * A symbol is somethig that has a name, a type and can be instantiated.
 */
@SuppressWarnings("serial")
abstract class Symbol implements Serializable{
	public String name;
	int lineNo;

	//type info constants
	public static final int regType      = 0x00000001;
	public static final int wireType     = 0x00000002;
	public static final int paramType    = 0x00000004;
	public static final int portType     = 0x00000010;
	public static final int realType     = 0x00000020;
	public static final int intType      = 0x00000040;
	public static final int funcType     = 0x00000080;
	public static final int taskType     = 0x00000100;
	public static final int blockType    = 0x00000200;
	public static final int moduleType   = 0x00100000;
	public static final int udpType      = 0x00200000;
	public static final int connType     = 0x00400000;
	public static final int moduleArType = 0x00800000;

	public Symbol(String name, int lineNo){
		this.name = name;
		this.lineNo = lineNo;
		xConsole.debug("new symbol :" + name + " at line " + lineNo);
	}

	abstract Object instantiate(NameSpace n, ScopeNode thisScope)
	throws ParseException;
	abstract public int getType();

	public String toString(){
		return name;
	}

}
